//
//  CalculatorViewController.h
//  MagicBox
//
//  Created by dllo on 16/8/22.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CGHBaseViewController.h"
#import "TSStack.h"

@interface CalculatorViewController : CGHBaseViewController<UITextFieldDelegate>
{
    
    NSMutableString *inputString_;
    NSString  *operatorStr_;
    NSMutableString *expression_;
    
}



@property (nonatomic ,copy) NSString *Calculator;

@property TSStack *inputStack_;

@property TSStack *numbersStack_;

@property TSStack *operatorStack_;

@property (weak, nonatomic) IBOutlet UIButton *dotButton;
@property (weak, nonatomic) IBOutlet UIButton *zeroButton;
@property (weak, nonatomic) IBOutlet UIButton *oneButton;
@property (weak, nonatomic) IBOutlet UIButton *twoButton;
@property (weak, nonatomic) IBOutlet UIButton *threeButton;
@property (weak, nonatomic) IBOutlet UIButton *FourButton;
@property (weak, nonatomic) IBOutlet UIButton *FiveButton;

@property (weak, nonatomic) IBOutlet UIButton *sixButton;

@property (weak, nonatomic) IBOutlet UIButton *SevenButton;
@property (weak, nonatomic) IBOutlet UIButton *EightButton;
@property (weak, nonatomic) IBOutlet UIButton *nineButton;
@property (weak, nonatomic) IBOutlet UIButton *emptyButton; //清空
@property (weak, nonatomic) IBOutlet UIButton *deleteButton; //清除
@property (weak, nonatomic) IBOutlet UIButton *exceptButton;
@property (weak, nonatomic) IBOutlet UIButton *rideButton;
@property (weak, nonatomic) IBOutlet UIButton *reduceButton;
@property (weak, nonatomic) IBOutlet UIButton *plusButton;
@property (weak, nonatomic) IBOutlet UIButton *beEqualToButton;
@property (weak, nonatomic) IBOutlet UILabel *InputLabel;
@property (weak, nonatomic) IBOutlet UILabel *finalExpressionLabel;

-(BOOL)isStackTopOperator:(TSStack *)stack;

-(BOOL)canCaculate:(NSString*)currentOperator compareWith:(NSString*)stackTopOperator;

- (IBAction)onceButton:(id)sender;



@end
